package com.zjsru.interview;

/**
 * @Author: likew
 * @Date: 2022/3/3
 *
 * 递归 返回5！ 即120
 * 面试题 要求写出递归
 */
public class digui {
    
    public static void main(String[] args) {
        digui digui = new digui();
        int num = 5;
        System.out.println(digui.dg(num));
        
    }
    private int dg(int num){
        if(num == 1 || num == 0){
            return 1;
        }else{
            return dg(num-1)*num;
        }
    }
}
